<link type="text/css" rel="stylesheet" href="themes/${theme}/forms.css" />
<script type='text/javascript'>
	$(document).ready(function(){
		$("#save").click(function() {
			if ($("#pbacklog_add").valid() == true) {
				$("#pbacklog_add").ajaxSubmit();
				$.nyroModalRemove();
				document.location.reload(true);
			} else {
				$("#nyroModalContent").css("height",$(window).height()+20);
			}
		}).mouseover(function(){
			$(this).css("cursor","pointer");
		});

//		$("#pbacklog_add").submit(function(){
//			$(this).ajaxSubmit();
//			return false;
//		});

		$("#pbacklog_add").validate({
			rules: {
				pbacklog_summary: {
					required: true
				},
				pbacklog_description: {
					required: true
				},
				pbacklog_priority: {
					required: true
				},
				pbacklog_user: {
					required: true
				}

			},
			messages: {
				pbacklog_summary: {
					required:  '<font color="#FF0000">${summary_required}</font>'
				},
				pbacklog_description: {
					required: '<font color="#FF0000">${description_required}</font>'
				},
				pbacklog_priority: {
					required: '<font color="#FF0000">${priority_required}</font>'
				},
				pbacklog_user: {
					required: '<font color="#FF0000">${user_required}</font>'
				}
			}
		});
		
		 $("#cancel").click(function(){
			$.nyroModalRemove();
		 }).mouseover(function(){
			$(this).css("cursor","pointer");
		 });
	});
</script>
<form method="post" action="projectbacklog_add.php" id="pbacklog_add">
<input type="hidden" name="project" id="project" value="${id}" />
<table width="480" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
	<tr>
		<td rowspan="3" class="form_left" width="20">&nbsp;</td>
		<td height="20" class="form_title">&nbsp;${title}</td>
	</tr>
	<tr>
		<td>
		<br />
		<table width="95%" border="0" cellpadding="1" cellspacing="1" align="center">
		<tr>
			<td colspan="2" align="center" height="20">${summary}</td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<textarea class="form_textarea" id="pbacklog_summary" name="pbacklog_summary"></textarea>
				<br />
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center" height="20">${description}</td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<textarea class="form_textarea" id="pbacklog_description" name="pbacklog_description"></textarea>
				<br />
			</td>
		</tr>
		<tr>	
			<td align="right">${priority}:&nbsp;</td>
			<td width="180"><input type="text" name="pbacklog_priority" id="pbacklog_priority" class="form_input" maxlength="4" /></td>
		</tr>
                <tr>
			<td align="right" height="20">${assignament}:&nbsp;</td>
			<td>
				<select id="pbacklog_user" name="pbacklog_user" class="form_input">
				<option tal:repeat="user users" value='${user/id_user}'>${user/name}</option>
				</select>
			</td>
		</tr>
		<tr>
			<td colspan="2" class="form_separator">&nbsp;</td>
		</tr>
		</table>
		<br />
		<table width="99%" border="0" cellpadding="1" cellspacing="1">
			<tr>
				<td align="right" height="40">
					<input type="submit" id="save" class="bt_blue" value="${bt_save}" />
				</td>
				<td width="65">
					<input type="submit" id="cancel" class="bt_blue" value="${bt_cancel}" />
				</td>
			</tr>
		</table>
		</td>
	</tr>
</table>
</form>
